package com.ifras.project;

import com.ifras.project.control.data.DatabaseHelper;

import android.content.Context;
import android.widget.Toast;


public class PolygonLogic {

	
	Context context;
	
	public PolygonLogic (Context context){
		this.context = context;
		
	}
	
	

public boolean givenCoordinateIsInside(double lat,double lng){
	
	  //testing values
			Polygon polygon = Polygon.Builder()
					.addVertex(new Point(6.930572, 79.864654))
					.addVertex(new Point(6.911486, 79.913406))
					.addVertex(new Point(6.885412, 79.856071))
					.addVertex(new Point(6.924267, 79.854355))
					// .addVertex(new Point(7, 5))
					// .addVertex(new Point(6, 1))
					// .addVertex(new Point(3, 1))
					.build();

			Toast.makeText(context, "boolean value "+isInside(polygon, new Point(lat, lng)), Toast.LENGTH_SHORT).show();
			
	
	
	return false;
	
	
}
	
 public boolean isInside(Polygon polygon, Point point){
	
	 return polygon.contains(point);
	 
 }
	
}
